<?php
use common\modules\rbac\Migration;
use common\modules\user\models\User;

class m150912_215624_init_permissions extends Migration
{

    public function up()
    {
        $managerRole = $this->auth->getRole(User::ROLE_MANAGER);
        
        $loginToBackend = $this->auth->createPermission('loginToBackend');
        $this->auth->add($loginToBackend);
        $this->auth->addChild($managerRole, $loginToBackend);
    }

    public function down()
    {
        $this->auth->remove($this->auth->getPermission('loginToBackend'));
    }
}
